package org.jsola.hr.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.jsola.core.dto.BaseDTO;

import java.util.Date;
import javax.validation.constraints.NotNull;

import static org.jsola.hr.example.ArticleExample.E_ARTICLE_TITLE;
import static org.jsola.hr.example.ArticleExample.E_ARTICLE_TYPE_ID;
import static org.jsola.hr.example.ArticleExample.E_BROWSE_NUM;
import static org.jsola.hr.example.ArticleExample.E_CONTENT;
import static org.jsola.hr.example.ArticleExample.E_ISSUE;
import static org.jsola.hr.example.ArticleExample.E_IS_TOP;
import static org.jsola.hr.example.ArticleExample.E_MAIN_PICTURE_URL;
import static org.jsola.hr.example.ArticleExample.E_RELEASE_TIME;
import static org.jsola.hr.example.ArticleExample.M_ARTICLE_TITLE_MAX;
import static org.jsola.hr.example.ArticleExample.M_ARTICLE_TITLE_NOT_NULL;
import static org.jsola.hr.example.ArticleExample.M_ARTICLE_TYPE_ID_NOT_NULL;
import static org.jsola.hr.example.ArticleExample.M_CONTENT_MAX;
import static org.jsola.hr.example.ArticleExample.M_CONTENT_NOT_NULL;
import static org.jsola.hr.example.ArticleExample.M_MAIN_PICTURE_URL_MAX;
import static org.jsola.hr.example.ArticleExample.N_ARTICLE_TITLE;
import static org.jsola.hr.example.ArticleExample.N_ARTICLE_TYPE_ID;
import static org.jsola.hr.example.ArticleExample.N_BROWSE_NUM;
import static org.jsola.hr.example.ArticleExample.N_CONTENT;
import static org.jsola.hr.example.ArticleExample.N_ISSUE;
import static org.jsola.hr.example.ArticleExample.N_IS_TOP;
import static org.jsola.hr.example.ArticleExample.N_MAIN_PICTURE_URL;
import static org.jsola.hr.example.ArticleExample.N_RELEASE_TIME;

/**
 * 人力文章
 *
 * @author zhr
 */
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "新增【人力文章】的参数")
@Data
public class ArticleAddDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(notes = N_CONTENT, example = E_CONTENT, required = true)
    @NotNull(message = M_CONTENT_NOT_NULL)
    @Length(max = 2147483647, message = M_CONTENT_MAX)
    private String content;

    @ApiModelProperty(notes = N_ISSUE, example = E_ISSUE)
    private Integer issue;

    @ApiModelProperty(notes = N_IS_TOP, example = E_IS_TOP)
    private Boolean isTop;

    @ApiModelProperty(notes = N_ARTICLE_TITLE, example = E_ARTICLE_TITLE, required = true)
    @NotNull(message = M_ARTICLE_TITLE_NOT_NULL)
    @Length(max = 30, message = M_ARTICLE_TITLE_MAX)
    private String articleTitle;

    @ApiModelProperty(notes = N_ARTICLE_TYPE_ID, example = E_ARTICLE_TYPE_ID, required = true)
    @NotNull(message = M_ARTICLE_TYPE_ID_NOT_NULL)
    private Long articleTypeId;

    @ApiModelProperty(notes = N_RELEASE_TIME, example = E_RELEASE_TIME)
    private Date releaseTime;

    @ApiModelProperty(notes = N_BROWSE_NUM, example = E_BROWSE_NUM)
    private Integer browseNum;

    @ApiModelProperty(notes = N_MAIN_PICTURE_URL, example = E_MAIN_PICTURE_URL)
    @Length(max = 255, message = M_MAIN_PICTURE_URL_MAX)
    private String mainPictureUrl;


}

